#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <math.h> 
#include <ctype.h> 
#include <time.h> 
#include <assert.h>

int main()
{
	int a = 0;
	scanf("%d", &a);
	int count = 0;
	while (a)
	{
		a = a & (a - 1);
		count++;
	}
	printf("%d\n", count);

	return 0;
}